<!-- 支付 -->
<template>
  <div class="">
    <div class="title">资源配置分润</div>
    <div class="tip">以下为机构开通功能中涉及支付的项目，与平台达成商务合作后，配置是否分佣及平台抽佣比例。</div>
    <!-- <div>温馨提示：涉及支付相关项目，请点击完成认证完善支付账号信息后生效。</div> -->
    <s-table
      ref="table"
      size="default"
      rowKey="id, enabled, title"
      :columns="columns"
      :data="loadData"
      :rowSelection="null"
      :showPagination="false"
    >
      <!-- 平台抽佣比例 -->
      <span slot="percent" slot-scope="text"> {{ text }}% </span>
    </s-table>
  </div>
</template>

<script>
import { STable } from '@/components'
import { BrokerageConfigInfo } from '@/api/system/base'
export default {
  components: {
    STable,
  },
  data() {
    return {
      labelCol: { span: 4 },
      wrapperCol: { span: 14 },
      form: {
        organ1: undefined,
        organ2: undefined,
        type: undefined,
        zuoji: undefined,
        person: undefined,
        phoneNum: undefined,
        email: undefined,
        address: undefined,
        logoUrl: undefined,
        imgUrl: undefined,
        desc: undefined,
      },
      columns: [
        {
          title: '合作支付项目',
          dataIndex: 'projectName',
          ellipsis: true,
          width: '100px',
        },
        {
          title: '平台抽佣比例',
          dataIndex: 'percent',
          ellipsis: true,
          width: '150px',
          scopedSlots: { customRender: 'percent' },
        },
        {
          title: '备注',
          dataIndex: 'remark',
          ellipsis: true,
          width: '150px',
        },
      ],
      loadData: async (parameter) => {
        var params = {
          current: parameter.pageNum,
          size: parameter.pageSize,
        }
        this.listLoading = true
        return BrokerageConfigInfo(Object.assign(params, this.queryParam))
          .then((res) => {
            this.listLoading = false
            if (res.code === 0) {
              this.pageNum = parameter.pageNum
              this.pageSize = parameter.pageSize
              return res
            } else {
              this.$message.error(res.msg)
            }
          })
          .catch((err) => {
            this.listLoading = false
            this.$message.error(err.msg)
          })
      },
    }
  },
  computed: {},
  watch: {},
  methods: {},
  created() {},
  mounted() {},
}
</script>
<style  scoped>
.title {
  font-size: 18px;
  font-weight: bold;
  padding: 10px 0;
}
.tip {
  padding: 10px 0;
}
</style>